<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>General Ledger Creation</title>

<script language="javascript" type="text/javascript">

function check()
{
	var gl1,gl2,gl3;
	
  	var namevalid=/^[a-zA-Z ]+$/;
  

        gl1= document.f5.ledgername.value;
        
        if(gl1.length==0)
        {
        	alert("Enter General Ledger Name");
            return false;
      	}
        else if(gl1.search(namevalid)==-1)
        {
            alert("Please Enter valid name");
            document.f5.ledgername.value="";
            document.f5.ledgername.focus();
            
	         return false;
    	 }
        
	    gl3= document.f5.glopeningbalance.value;
        if(gl3.length == 0)
        {
            alert("Please Enter General Ledger Opening Balance");
            return false;
        }
        
        if(!gl3.match(/^\d+$/))
      	{
       		alert("Please Enter Opening Balance in Numerics only");
            return false;
      	 }
             return true;
    }

</script>

</head>
<body>

<form name="f5" action="GeneralLedgerServlet" ONSUBMIT="return check()">

<table border=0>

<tr>
	<td> Name of the Ledger </td>
	<td> <input type="text" name="ledgername"></td>
</tr>

<tr>
	<td> Group </td>
	<td> <select name="ledgergroup" id="ledgergroup">
			<option>  </option>
			<option> Capital </option>
			<option> Secured Loans</option>
			<option> Unsecured Loans </option>
			<option> Provision </option>
			<option> Fixed Assets </option>
			<option> Investments </option>
			<option> Closing Stock </option>
			<option> Loans And Advances </option>
			<option> Opening Stock </option> 
			<option> Indirect Income </option>
			<option> Administrative Charges </option>
			<option> Bank Charges and Interest </option>
			<option> Selling and Marketing Expenses </option>
			<option> Salary and Wages </option>
			<option> Depreciation </option>
			<option> Other Expenses </option>
		 </select>
	</td>
</tr>

<tr>
	<td> Opening Balance </td>
	<td> <input type="text" name="glopeningbalance"></td>
</tr>

<tr>
	<td> <input type="submit" value="submit"> </td>  
</tr>

</table>
</form>

</body>
</html>